# $Id: PKGBUILD 182655 2013-04-12 07:29:25Z tpowa $
# Contributor: Dennis "Gyroplast" Herbrich <dennis@archlinux.org>,  dorphell <dorphell@archlinux.org>
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>

pkgname=isdn4k-utils
pkgver=3.25_20130409
pkgrel=1
pkgdesc="User space administration programs and tools for ISDN"
arch=('i686' 'x86_64')
url="http://www.isdn4linux.de/"
license=('GPL')
depends=('ncurses' 'sh') 
backup=(etc/isdn/{callerid.conf,isdn.conf,rate.conf,isdnlog.isdnctrl0.options})
options=('!makeflags' '!libtool')
source=(ftp://ftp.archlinux.org/other/isdn4k-utils/${pkgname}-${pkgver}.tar.gz
        isdn4k-utils-3.25-build.patch
        config)
replaces=('capi4k-utils')

prepare() {
  CPPFLAGS="$CPPFLAGS -O2"
  cd $srcdir/$pkgname-$pkgver
  cp $srcdir/config ./.config
  patch -Np0 -i $srcdir/isdn4k-utils-3.25-build.patch
  cd capiinfo
  aclocal
  automake --add-missing
  autoreconf
  cd $srcdir/$pkgname-$pkgver
  cd capifax
  aclocal 
  automake --add-missing
  autoreconf
  cd $srcdir/$pkgname-$pkgver
  make subconfig
}

build() {
  cd $srcdir/$pkgname-$pkgver
  make
}

package() {
  cd $srcdir/$pkgname-$pkgver
  install -dm755 $pkgdir/usr/sbin
  make DESTDIR=$pkgdir install
  chmod 755 $pkgdir/usr/sbin/*
}
md5sums=('0c464e0e104d548e4fde0e623b4b943a'
         'dfd9590d3300020a5612c565d5add266'
         'be387b5e03b744452dea7571600f83aa')
